﻿using PlatformNetCore.Common;
using PlatformNetCore.Entity;
using PlatformNetCore.Entity.Models;
using PlatformNetCore.IRepository;
using PlatformNetCore.IService;
using System;
using System.Linq;
using System.Linq.Expressions;

namespace PlatformNetCore.Service
{
    public class ViewService : IViewService
    {
        private readonly IOrdersRemain_ViewRepository ordersRemain_ViewRepository;
        public ViewService(IOrdersRemain_ViewRepository _ordersRemain_ViewRepository)
        {
            ordersRemain_ViewRepository = _ordersRemain_ViewRepository;
        }

        #region 订单用工人员剩余额度
        /// <summary>
        /// 获取商户的月度 薪酬区间
        /// </summary>
        /// <returns></returns>
        public LayPager<OrdersRemain_View> GetOrdersRemainView(Expression<Func<OrdersRemain_View, bool>> predicate)
        {
            var list = ordersRemain_ViewRepository.GetList(predicate).ToList();
            LayPager<OrdersRemain_View> pmodel = new LayPager<OrdersRemain_View>();
            if (list != null)
            {
                pmodel.count = list.Count;
                pmodel.msg = CommonConst.Success;
                pmodel.data = list.ToList();
            }
            return pmodel;
        }
        #endregion
        
    }
}
